import java.util.ArrayList;
import java.util.Scanner;

public class TheEndProblem {
    public static int getAge(stu k) {
        int num = k.number;

        return num;
    }
    public static ArrayList<stu> Student(ArrayList<stu> list){
        ArrayList<stu> newList = new ArrayList();
        for (int i = 0; i < list.size(); i++) {
            int k =getAge(list.get(i));
            if (k<18){
                newList.add(list.get(i));
            }
        }
        return newList;
    }

    public static void main(String[] args) {
        ArrayList j = new ArrayList<>();
        stu stu1 = new stu();
        stu1.name="小红";
        stu1.number=1;
        stu stu2 = new stu();
        stu2.name="小明";
        stu2.number=2;
        ArrayList p =new ArrayList();
               p = Student(j);
        System.out.println();

    }
}
